

$(function(){
	//地图
	drawMap();
	drawPies();//绘制饼图
	fetchbg();//表格报告
	fetchstatistics();//加载头部数据
	fetchstatistics1();//加载尾部数据
	fetchyygsOutReturnWork();//运营公司返岗
	fetchfyygsOutReturnWork();//非运营公司返岗
	fetchyygsTrend();//运营公司返岗趋势
	fetchfyygsTrend();//非运营公司返岗趋势
	fetchyqqs(); //疫情趋势
	getPxInfo();//员工培训当日信息
});

function drawMap(){
	var mapData = [];
	var data = {type:'1', conditionDate : new Date().format("yyyy-MM-dd")};
	$.ajax({
		url : "search/mapdata",
		dataType : "json",
		data : data,
		success : function(data) {
			for(var i in data){
				if(data[i].area=='湖北'){
					mapData.push({name: '湖北',value: [111.5,31,data[i].numberOfPeople]});
				}
				if(data[i].area=='上海'){
					mapData.push({name: '上海',value: [121.5,31,data[i].numberOfPeople]});
				}
				if(data[i].area=='境外'){
					mapData.push({name: '境外',value: [102,51,data[i].numberOfPeople]});
				}
				if(data[i].area=='其他'){
					mapData.push({name: '其他',value: [94,36,data[i].numberOfPeople]});
				}
			}
			var mycharts = echarts.init(document.getElementById('mapss'));
		    var mapOption = {
		    		geo: {
		    	        map: 'china',
		    	    },
			    title : {
			        text: '',
// 			        top :'5%',
			        textStyle:{//标题内容的样式
						fontStyle:'normal',//主标题文字字体风格，默认normal，有italic(斜体),oblique(斜体)
						fontWeight:"bold",//可选normal(正常)，bold(加粗)，bolder(加粗)，lighter(变细)，100|200|300|400|500...
						fontFamily:"san-serif",//主题文字字体，默认微软雅黑
						fontSize:28//主题文字字体大小，默认为18px
					},
					textAlign:'left',//标题文本水平对齐方式，
			    },
			    
// 			    tooltip : {
// 			        trigger: 'item',
// 			        position: ['50%', '50%']
// 			    },
			    visualMap: {
			        min: 0,
			        max: 30000,
			        left: 'left',
			        top: 'bottom',
			        text:['高','低'],           // 文本，默认为数值文本
			        calculable : true
			    },
			    series : [
			        {
			            name: '员工分布',
			            type: 'map',
			            mapType: 'china',
			            roam: false
			        },
			        // 区域散点图
			        {
			            type: 'effectScatter',
			            coordinateSystem: 'geo',
			            label: {
			                normal: {
			                    show: true,
			                    position: 'bottom',
			                    formatter:function(param){
			    		        		
									return param.name+"\n"+param.value[2];
			    		        },
			                    textStyle :{
			                    	fontSize:20,
			                    	fontWeight:"bold",
			                    	color :'#2E4453'
			                    }
			                }
			            },
			            symbol:"circle",
			            data: mapData
			        }
			    ]
			};
		    mycharts.setOption(mapOption);
		    }

	});
}

function drawPies(){
	var colorList1 = ['#3bafff','#3feed4','#00d488','#afa3f5'];
	var colorList2 = ['#f1bb4c','#43E5FF','#FF5E5E','#FFE82A'];
	var colorList3 = ['#8558f0', 'd16200','#3bafff','#3feed4'];
	var data1 = [];
	var data2 = [];
	var data3 = [];
	var data = {type:'1', conditionDate : new Date().format("yyyy-MM-dd")};
	$.ajax({
		url : "./search/fetchStatisticswc",
		dataType : "json",
		data : data,
		async:false,
		success : function(data) {
	    	var val1 = {value:data[0].amountOfHubei,name:'湖北省'};
	    	var val2 = {value:data[0].amountOfAbroad,name:'出境'};
	    	var val3 = {value:data[0].amountOfExceed,name:'病例超200人省份'};
	    	var val4 = {value:data[0].amountOfOther,name:'其他省份'};
	    	data1.push(val1);
	    	data1.push(val3);
	    	data1.push(val4);
	    	data1.push(val2);
	    	
		}
	});
	$.ajax({
		url : "./search/fetchStatisticshh",
		dataType : "json",
		data : data,
		async:false,
		success : function(data) {
	    	var val1 = {value:data[0].totalAmountOfHubeiReturn,name:'湖北省'};
	    	var val2 = {value:data[0].totalAmountOfAbroadReturn,name:'出境'};
	    	var val3 = {value:data[0].totalAmountOfExceedReturn,name:'病例超200人省份'};
	    	var val4 = {value:data[0].totalAmountOfOtherReturn,name:'其他省份'};
	    	data2.push(val1);
	    	data2.push(val2);
	    	data2.push(val3);
	    	data2.push(val4);
		}
	});
	$.ajax({
		url : "./search/fetchStatisticsfg",
		dataType : "json",
		data : data,
		async:false,
		success : function(data) {
	    	var val1 = {value:data[0].totalAmountOfHubeiWork,name:'湖北省'};
	    	var val2 = {value:data[0].totalAmountOfAbroadWork,name:'出境'};
	    	var val3 = {value:data[0].totalAmountOfExceedWork,name:'病例超200人省份'};
	    	var val4 = {value:data[0].totalAmountOfOtherWork,name:'其他省份'};
	    	data3.push(val1);
	    	data3.push(val2);
	    	data3.push(val3);
	    	data3.push(val4);
		}
	});
	
	var pieChart1 = echarts.init(document.getElementById('pie_one'));
	option1 = {
	        legend: {
	            show:false,
	            orient: 'vertical',
	            top: "middle",
	            right: "5%",
	            textStyle: {
	                color: '#f2f2f2',
	                fontSize: 25,

	            },
	            icon: 'roundRect'
	        },
	        series: [
	            // 主要展示层的
	            {
	                radius: ['45%', '70%'],
	                center: ['50%', '55%'],
	                type: 'pie',
	                avoidLabelOverlap: true,
	                itemStyle: {
	                    normal: {
	                        color: function(params) {
	                            return colorList1[params.dataIndex]
	                        }
	                    }
	                },
	                labelLine: {
	                    normal: {
	                        show: true,
	                        length: 15,
	                        length2: 15,
	                        lineStyle: {
	                            color: '#d3d3d3'
	                        },
	                        align: 'right'
	                    },
	                    color: "#000",
	                    emphasis: {
	                        show: true
	                    }
	                },
	                label:{
	                    normal:{
	                        formatter: function(params){
	                            return '{a|}{nameStyle|'+params.name+' \n   '+params.value+'人}\n   '+'{rate|'+params.percent.toFixed(2)+'%}';
	                        },
	                        label:{
	                        	fontSize: 14,
	                        },
	                        rich: {
	                            nameStyle: {
	                                fontSize: 14,
	                                color: "#555",
	                                align: 'left'
	                            },
	                            rate: {
	                                fontSize: 18,
	                                color: "#1ab4b8",
	                                align: 'left'
	                            }
	                        }
	                    }
	                },
	                data: data1
	            },
	            // 边框的设置
	            {
	                radius: ['64%', '70%'],
	                center: ['50%', '55%'],
	                type: 'pie',
	                label: {
	                    normal: {
	                        show: false
	                    },
	                    emphasis: {
	                        show: false
	                    }
	                },
	                labelLine: {
	                    normal: {
	                        show: false
	                    },
	                    emphasis: {
	                        show: false
	                    }
	                },
	                animation: false,
	                tooltip: {
	                    show: false
	                },
	                itemStyle: {
	                    normal: {
	                        color:'rgba(250,250,250,0.5)'
	                    }
	                },
	                data: [{
	                    value: 1,
	                }],
	            }
	        ]
    };
	pieChart1.setOption(option1);
    	
	
	var pieChart2 = echarts.init(document.getElementById('pie_two'));
	option2 = {
	        legend: {
	            show:false,
	            orient: 'vertical',
	            top: "middle",
	            right: "5%",
	            textStyle: {
	                color: '#f2f2f2',
	                fontSize: 25,

	            },
	            icon: 'roundRect'
	        },
	        series: [
	            // 主要展示层的
	            {
	                radius: ['45%', '70%'],
	                center: ['50%', '55%'],
	                type: 'pie',
	                avoidLabelOverlap: true,
	                itemStyle: {
	                    normal: {
	                        color: function(params) {
	                            return colorList2[params.dataIndex]
	                        }
	                    }
	                },
	                labelLine: {
	                    normal: {
	                        show: true,
	                        length: 15,
	                        length2: 15,
	                        lineStyle: {
	                            color: '#d3d3d3'
	                        },
	                        align: 'right'
	                    },
	                    color: "#000",
	                    emphasis: {
	                        show: true
	                    }
	                },
	                label:{
	                    normal:{
	                        formatter: function(params){
	                            return '{a|}{nameStyle|'+params.name+' \n   '+params.value+'人}\n   '+'{rate|'+params.percent.toFixed(2)+'%}';
	                        },
	                        label:{
	                        	fontSize: 14,
	                        },
	                        rich: {
	                            nameStyle: {
	                                fontSize: 14,
	                                color: "#555",
	                                align: 'left'
	                            },
	                            rate: {
	                                fontSize: 18,
	                                color: "#1ab4b8",
	                                align: 'left'
	                            }
	                        }
	                    }
	                },
	                data: data2
	            },
	            // 边框的设置
	            {
	                radius: ['64%', '70%'],
	                center: ['50%', '55%'],
	                type: 'pie',
	                label: {
	                    normal: {
	                        show: false
	                    },
	                    emphasis: {
	                        show: false
	                    }
	                },
	                labelLine: {
	                    normal: {
	                        show: false
	                    },
	                    emphasis: {
	                        show: false
	                    }
	                },
	                animation: false,
	                tooltip: {
	                    show: false
	                },
	                itemStyle: {
	                    normal: {
	                        color:'rgba(250,250,250,0.5)'
	                    },
	                },
	                data: [{
	                    value: 1,
	                }],
	            }
	        ]
    };
	pieChart2.setOption(option2);
	
	var pieChart3 = echarts.init(document.getElementById('pie_three'));
	option3 = {
	        legend: {
	            show:false,
	            orient: 'vertical',
	            top: "middle",
	            right: "5%",
	            textStyle: {
	                color: '#f2f2f2',
	                fontSize: 25,

	            },
	            icon: 'roundRect'
	        },
	        series: [
	            // 主要展示层的
	            {
	                radius: ['45%', '70%'],
	                center: ['50%', '55%'],
	                type: 'pie',
	                avoidLabelOverlap: true,
	                itemStyle: {
	                    normal: {
	                        color: function(params) {
	                            return colorList3[params.dataIndex]
	                        },
	                    }
	                },
	                labelLine: {
	                    normal: {
	                        show: true,
	                        length: 15,
	                        length2: 15,
	                        lineStyle: {
	                            color: '#d3d3d3'
	                        },
	                        align: 'right'
	                    },
	                    color: "#000",
	                    emphasis: {
	                        show: true
	                    }
	                },
	                label:{
	                    normal:{
	                        formatter: function(params){
	                            return '{a|}{nameStyle|'+params.name+' \n   '+params.value+'人}\n   '+'{rate|'+params.percent.toFixed(2)+'%}';
	                        },
	                        label:{
	                        	fontSize: 14,
	                        },
	                        rich: {
	                            nameStyle: {
	                                fontSize: 14,
	                                color: "#555",
	                                align: 'left'
	                            },
	                            rate: {
	                                fontSize: 18,
	                                color: "#1ab4b8",
	                                align: 'left'
	                            }
	                        }
	                    }
	                },
	                data: data3
	            },
	            // 边框的设置
	            {
	                radius: ['64%', '70%'],
	                center: ['50%', '55%'],
	                type: 'pie',
	                label: {
	                    normal: {
	                        show: false
	                    },
	                    emphasis: {
	                        show: false
	                    }
	                },
	                labelLine: {
	                    normal: {
	                        show: false
	                    },
	                    emphasis: {
	                        show: false
	                    }
	                },
	                animation: false,
	                tooltip: {
	                    show: false
	                },
	                itemStyle: {
	                    normal: {
	                        color:'rgba(250,250,250,0.5)'
	                    }
	                },
	                data: [{
	                    value: 1,
	                }],
	            }
	        ]
    };
	pieChart3.setOption(option3);
	
}

function fetchbg(){
	var yygsbgStr="";
	var fyygsbgStr="";
	var data1 = {type:'1', conditionDate : new Date().format("yyyy-MM-dd"),isOperation:'1'};
	var data2 = {type:'1', conditionDate : new Date().format("yyyy-MM-dd"),isOperation:'0'};
	$.ajax({
		url : "search/fetchReport",
		dataType : "json",
		data : data1,
		success : function(data) {
			for(var i in data){
				yygsbgStr+="<tr><td>"+data[i].companyName+"</td>";
				yygsbgStr+="<td>"+data[i].amountOfNonlocal+"</td>";
				yygsbgStr+="<td>"+data[i].totalAmountOfWork+"</td>";
				yygsbgStr+="<td>"+data[i].rateWork.toFixed(2)+"%</td>";
				yygsbgStr+="<td>"+data[i].lastReturn+"</td>";
				yygsbgStr+="<td>"+data[i].currReturn+"</td>";
				yygsbgStr+="<td>"+data[i].lastWork+"</td>";
				yygsbgStr+="<td>"+data[i].currWork+"</td></tr>";
			}
			$("#yygsbgbody").html(yygsbgStr);
		}
	});
	
	$.ajax({
		url : "search/fetchReport",
		dataType : "json",
		data : data2,
		success : function(data) {
			for(var i in data){
				fyygsbgStr+="<tr><td>"+data[i].companyName+"</td>";
				fyygsbgStr+="<td>"+data[i].amountOfNonlocal+"</td>";
				fyygsbgStr+="<td>"+data[i].totalAmountOfWork+"</td>";
				fyygsbgStr+="<td>"+data[i].rateWork.toFixed(2)+"%</td>";
				fyygsbgStr+="<td>"+data[i].lastReturn+"</td>";
				fyygsbgStr+="<td>"+data[i].currReturn+"</td>";
				fyygsbgStr+="<td>"+data[i].lastWork+"</td>";
				fyygsbgStr+="<td>"+data[i].currWork+"</td></tr>";
			}
			$("#fyygsbgbody").html(fyygsbgStr);
		}
	});
}

function fetchstatistics() {
	var data = {type:'1', conditionDate : new Date().format("yyyy-MM-dd")};
	$.ajax({
		url : "search/fetchSummary",
		dataType : "json",
		data : data,
		success : function(data) {
			$("#endDate").html(data[0].statisticDate);
			$("#amountOfNonlocal").html(data[0].amountOfNonlocal);
			$("#totalAmountOfWork").html(data[0].totalAmountOfWork);
			$("#totalAmountOfReturn").html(data[0].totalAmountOfReturn);
		}
	});
}
function fetchstatistics1() {
	var data = {type:'1', conditionDate : new Date().format("yyyy-MM-dd")};
	$.ajax({
		url : "search/fetchSummaryFever",
		dataType : "json",
		data : data,
		success : function(data) {
			$("#totalAmountFOfever").html(data[0].totalAmountFOfever);
			$("#totalAmountOfSeemingly").html(data[0].totalAmountOfSeemingly);
			$("#totalAmountOfConfirmed").html(data[0].totalAmountOfConfirmed);
			$("#totalAmountOfCured").html(data[0].totalAmountOfCured);
		}
	});
}

function fetchyygsOutReturnWork(){
	
	var datax1 = [];
	var datay11 = [];
	var datay12 = [];
	var datay13 = [];
	var data = {type:'1', isOperation : '1'};
	$.ajax({
		url : "./search/fetchOutReturnWork",
		dataType : "json",
		data :data,
		async:false,
		success : function(data) {
			for(var i=0;i<data.length;i++){
				datax1.push(data[i].statisticDate);
				datay11.push(data[i].amountOfNonlocal);
				datay12.push(data[i].totalAmountOfWork);
				datay13.push((data[i].totalAmountOfWork/data[i].amountOfNonlocal*100).toFixed(2));
			}
			var myChart = echarts.init(document.getElementById('mains_one'));
			// option
			var option = {
			    title: {
			        x: 'center',
			        y: 0,
			        textStyle:{
			            color:'#B4B4B4',
			            fontSize:20,
			            fontWeight:'normal',
			        },
			        
			    },
			    tooltip: {
			        trigger: 'axis',
			    },
			    legend: {
			        data: ['外出总人数', '返岗总人数','返岗率',],
			        textStyle: {
			            color: '#B4B4B4',
			            fontSize:20,
			        },
			        top:'7%',
			    },
			    grid:{
			        left: '12%',  
					right: '12%', 
			    },
			    xAxis: {
			        data: datax1,
			        axisLine: {
			            lineStyle: {
			                color: '#B4B4B4'
			            }
			        },
			        axisLabel:{
			        	rotate : 45
			        },
			        axisTick:{
			            show:false,
			        },
			    },
			    yAxis: [{
			        splitLine: {show: false},
			        axisLine: {
			            lineStyle: {
			                color: '#B4B4B4',
			            }
			        },
			        axisLabel:{
			            formatter:'{value}',
			        }
			    	},
			        {
			        splitLine: {show: false},
			        min: 0,
		            max: 100,
			        axisLine: {
			            lineStyle: {
			                color: '#B4B4B4',
			            }
			        },
			        axisLabel:{
			            formatter:'{value}%',
			        }
			    }],
			    dataZoom: [{
					show: true,
					height: 20,
					startValue: datax1.length-10,
					handleStyle:{
						color:"#d3dee5",

					},
					textStyle:{
						color:"#fff"
					},
					borderColor:"#90979c"

				}, {
					type: "inside",
					show: true,
					height: 15,
					start: 1,
					end: 35
				}],
			    series: [
			    {
			        name: '外出总人数',
			        type: 'bar',
			        barWidth: 10,
			        itemStyle: {
		                normal: {
		                    barBorderRadius: 5,
		                    color: new echarts.graphic.LinearGradient(
				                    0, 0, 0, 1,
				                    [
				                        {offset: 0, color: '#CCE6F5'},
				                        {offset: 1, color: '#E3F1E4'}
				                    ]
				                )
		                }
		            },
			        data: datay11
			    }, 
			    
			    {
			        name: '返岗总人数',
			        type: 'bar',
			        barGap: '-100%',
			        barWidth: 10,
			        itemStyle: {
		            	normal: {
			                barBorderRadius: 5,
			                color: new echarts.graphic.LinearGradient(
				                    0, 0, 0, 1,
				                    [
				                        {offset: 0, color: '#4DA2DA'},
				                        {offset: 1, color: '#00D488'}
				                    ]
				                )
			                
			            }
		            },
			        
			        data: datay12
			    },
			    {
			        name: '返岗率',
			        type: 'line',
			        smooth: true,
			        showAllSymbol: true,
			        symbol: 'emptyCircle',
			        symbolSize: 8,
			        yAxisIndex: 1,
			        itemStyle: {
		                normal: {
		                	color:'#FF5E5E',
		                	label: {
		                        show: true,
		                        position: "top",
		                        formatter: function(params){
		                            return params.value+'%';
		                        },
		                    }
	                	},
		        	},
			        data: datay13
			    }
			   ]
			};
			myChart.setOption(option);
			
		}
	});
}

function fetchfyygsOutReturnWork(){
	
	var datax1 = [];
	var datay11 = [];
	var datay12 = [];
	var datay13 = [];
	var data = {type:'1', isOperation : '0'};
	$.ajax({
		url : "./search/fetchOutReturnWork",
		dataType : "json",
		data : data,
		async:false,
		success : function(data) {
			for(var i=0;i<data.length;i++){
				datax1.push(data[i].statisticDate);
				datay11.push(data[i].amountOfNonlocal);
				datay12.push(data[i].totalAmountOfWork);
				datay13.push((data[i].totalAmountOfWork/data[i].amountOfNonlocal*100).toFixed(2));
			}
			var myChart = echarts.init(document.getElementById('mains_two'));
			// option
			var option = {
			    title: {
			        x: 'center',
			        y: 0,
			        textStyle:{
			            color:'#B4B4B4',
			            fontSize:13,
			            fontWeight:'normal',
			        },
			        
			    },
			    tooltip: {
			        trigger: 'axis',
			    },
			    legend: {
			        data: ['外出总人数', '返岗总人数','返岗率',],
			        textStyle: {
			            color: '#B4B4B4',
			            fontSize:20,
			        },
			        top:'7%',
			    },
			    grid:{
			        left: '12%',  
					right: '12%', 
			    },
			    xAxis: {
			        data: datax1,
			        axisLine: {
			            lineStyle: {
			                color: '#B4B4B4'
			            }
			        },
			        axisLabel:{
			        	rotate : 45
			        },
			        axisTick:{
			            show:false,
			        },
			    },
			    yAxis: [{
			        splitLine: {show: false},
			        axisLine: {
			            lineStyle: {
			                color: '#B4B4B4',
			            }
			        },
			        axisLabel:{
			            formatter:'{value}',
			        }
			    	},
			        {
			        splitLine: {show: false},
			        min: 0,
		            max: 100,
			        axisLine: {
			            lineStyle: {
			                color: '#B4B4B4',
			            }
			        },
			        axisLabel:{
			            formatter:'{value}%',
			        }
			    }],
			    dataZoom: [{
					show: true,
					height: 20,
					startValue: datax1.length-10,
					handleStyle:{
						color:"#d3dee5",

					},
					textStyle:{
						color:"#fff"
					},
					borderColor:"#90979c"

				}, {
					type: "inside",
					show: true,
					height: 15,
					start: 1,
					end: 35
				}],
			    series: [
			    {
			        name: '外出总人数',
			        type: 'bar',
			        barWidth: 10,
			        itemStyle: {
			            normal: {
			                barBorderRadius: 5,
			                color: new echarts.graphic.LinearGradient(
				                    0, 0, 0, 1,
				                    [
				                    	{offset: 0, color: '#CCE6F5'},
				                        {offset: 1, color: '#E3F1E4'}
				                    ]
				                )
			            }
			        },
			        data: datay11
			    }, 
			    
			    {
			        name: '返岗总人数',
			        type: 'bar',
			        barGap: '-100%',
			        barWidth: 10,
			        itemStyle: {
			            normal: {
			                barBorderRadius: 5,
			                color: new echarts.graphic.LinearGradient(
				                    0, 0, 0, 1,
				                    [
				                    	{offset: 0, color: '#4DA2DA'},
				                        {offset: 1, color: '#00D488'}
				                    ]
				                )
			                
			            }
			        },
			        data: datay12
			    },
			    {
			        name: '返岗率',
			        type: 'line',
			        smooth: true,
			        showAllSymbol: true,
			        symbol: 'emptyCircle',
			        symbolSize: 8,
			        yAxisIndex: 1,
			        itemStyle: {
			        	normal: {
		                	color:'#FF5E5E',
		                	label: {
		                        show: true,
		                        position: "top",
		                        formatter: function(params){
		                            return params.value+'%';
		                        },
		                    }
	                	},
			        },
			        data: datay13
			    }
			   ]
			};
			myChart.setOption(option);
			
		}
	});
}

function fetchyygsTrend(){
	var datax1 = [];
	var datay11 = [];
	var datay12 = [];
	var datay13 = [];
	var data = {type:'1', isOperation : '1'};
	
	$.ajax({
		url : "./search/fetchWorkTrend",
		dataType : "json",
		data : data,
		async:false,
		success : function(data) {
			for(var i=0;i<data.length;i++){
				datax1.push(data[i].statisticDate);
				datay11.push(data[i].actualarrival);
				datay12.push(data[i].expectedarrival);
				datay13.push(data[i].totalPeople);
			}
			var myChart = echarts.init(document.getElementById('main_four'));
			var option = {
		    tooltip: {
		        trigger: 'axis'
		    },
		    legend: {
		        data: ['员工总人数', '当前可返岗人数','预计返岗人数'],
		        left: 'center',
		        top: 'top',
		        textStyle: {
		            fontSize:20,
		        },
		    },
		    grid: {
		        top: '15%',
		        left: '15%',
		        right: '5%',
		    },
		    xAxis: {
		        type: 'category',
		        data: datax1,
		        axisLabel:{
		        	rotate : 45
		        },
		    },
		    yAxis: {
		        type: 'value',
		        min : 26000,
		        max : 28000,
		        splitLine: {
		            lineStyle: {
		                type: 'dashed',
		                color: '#DDD'
		            }
		        },
		        axisLine: {
		            show: false,
		            lineStyle: {
		                color: "#333"
		            },
		        },
		        nameTextStyle: {
		            color: "#999"
		        },
		        splitArea: {
		            show: false
		        }
		    },
		    dataZoom: [{
				show: true,
				height: 20,
				startValue: datax1.length-10,
				handleStyle:{
					color:"#d3dee5",

				},
				textStyle:{
					color:"#fff"
				},
				borderColor:"#90979c"

			}, {
				type: "inside",
				show: true,
				height: 15,
				start: 1,
				end: 35
			}],
		    series: [{
		            name: '员工总人数',
		            type: 'line',
		            data: datay13,
		            lineStyle: {
		                normal: {
		                    width: 3,
		                    color: {
		                        type: 'linear',
		                        colorStops: [{
		                            offset: 0,
		                            color: '#FFE4C2' // 0% 处的颜色
		                        }, {
		                            offset: 1,
		                            color: '#DCAE73' // 100% 处的颜色
		                        }],
		                        globalCoord: false // 缺省为 false
		                    },
		                }
		            },
		            itemStyle: {
		                normal: {
		                    color: '#DCAE73',
		                    borderWidth: 5,
		                    borderColor: "#DCAE73"
		                }
		            },
		            smooth: true
		        },
		        {
		            name: '当前可返岗人数',
		            type: 'line',
		            data: datay11,
		            lineStyle: {
		                normal: {
		                    width: 3,
		                    color: {
		                        type: 'linear',
		                        colorStops: [{
		                                offset: 0,
		                                color: '#B3DDEE' // 0% 处的颜色
		                            },
		                            {
		                                offset: 1,
		                                color: '#69C5E9' // 100% 处的颜色
		                            }
		                        ],
		                        globalCoord: false // 缺省为 false
		                    },
		                }
		            },
		            itemStyle: {
		                normal: {
		                    color: '#69C5E9',
		                    borderWidth: 5,
		                    borderColor: "#69C5E9",
		                    label:{
		                    	show:true,
		                    	position:"bottom"
		                    }
		                }
		            },
		            smooth: true
		        },
		        {
		            name: '预计返岗人数',
		            type: 'line',
		            data: datay12,
		            color: "#F58080",
		            lineStyle: {
		                normal: {
		                    width: 3,
		                    color: {
		                        type: 'linear',

		                        colorStops: [{
		                            offset: 0,
		                            color: '#FFC9EB' // 0% 处的颜色
		                        },{
		                            offset: 1,
		                            color: '#F095CE' // 100% 处的颜色
		                        }],
		                        globalCoord: false // 缺省为 false
		                    },
		                }
		            },
		            itemStyle: {
		                normal: {
		                    color: '#F095CE',
		                    borderWidth: 5,
		                    borderColor: "#F095CE",
		                    label:{
		                    	show:true,
		                    	position:"bottom"
		                    }
		                }
		            },
		            smooth: true
		        },
		    ]
		};
		myChart.setOption(option);
		}
	});
}

function fetchfyygsTrend(){
	var datax1 = [];
	var datay11 = [];
	var datay12 = [];
	var datay13 = [];
	var data = {type:'1', isOperation : '0'};
	$.ajax({
		url : "./search/fetchWorkTrend",
		dataType : "json",
		async:false,
		data : data,
		success : function(data) {
			for(var i=0;i<data.length;i++){
				datax1.push(data[i].statisticDate);
				datay11.push(data[i].actualarrival);
				datay12.push(data[i].expectedarrival);
				datay13.push(data[i].totalPeople);
			}
			var myChart = echarts.init(document.getElementById('main_five'));
			var option = {
		    tooltip: {
		        trigger: 'axis'
		    },
		    legend: {
		        data: ['员工总人数', '当前可返岗人数','预计返岗人数'],
		        left: 'center',
		        top: 'top',
		        textStyle: {
		            fontSize:20,
		        },
		    },
		    grid: {
		    	top: '15%',
		        left: '12%',
		        right: '5%',
		    },
		    xAxis: {
		        type: 'category',
		        data: datax1,
		        axisLabel:{
		        	rotate : 45
		        },
		    },
		    yAxis: {
		        type: 'value',
		        min : 1500,
		        max : 3000,
		        splitLine: {
		            lineStyle: {
		                type: 'dashed',
		                color: '#DDD'
		            }
		        },
		        axisLine: {
		            show: false,
		            lineStyle: {
		                color: "#333"
		            },
		        },
		        nameTextStyle: {
		            color: "#999"
		        },
		        splitArea: {
		            show: false
		        }
		    },
		    dataZoom: [{
				show: true,
				height: 20,
				startValue: datax1.length-10,
				handleStyle:{
					color:"#d3dee5",

				},
				textStyle:{
					color:"#fff"
				},
				borderColor:"#90979c"

			}, {
				type: "inside",
				show: true,
				height: 15,
				start: 1,
				end: 35
			}],
		    series: [{
		            name: '员工总人数',
		            type: 'line',
		            data: datay13,
		            color: "#F58080",
		            lineStyle: {
		                normal: {
		                    width: 3,
		                    color: {
		                        type: 'linear',
		                        colorStops: [{
		                            offset: 0,
		                            color: '#FFE4C2' // 0% 处的颜色
		                        }, {
		                            offset: 1,
		                            color: '#DCAE73' // 100% 处的颜色
		                        }],
		                        globalCoord: false // 缺省为 false
		                    },
		                }
		            },
		            itemStyle: {
		                normal: {
		                    color: '#DCAE73',
		                    borderWidth: 5,
		                    borderColor: "#DCAE73"
		                }
		            },
		            smooth: true
		        },
		        {
		            name: '当前可返岗人数',
		            type: 'line',
		            data: datay11,
		            lineStyle: {
		                normal: {
		                    width: 3,
		                    color: {
		                        type: 'linear',
		                        colorStops: [{
	                                offset: 0,
	                                color: '#B3DDEE' // 0% 处的颜色
	                            },
	                            {
	                                offset: 1,
	                                color: '#69C5E9' // 100% 处的颜色
	                            }
	                            ],
		                        globalCoord: false // 缺省为 false
		                    },
		                }
		            },
		            itemStyle: {
		                normal: {
		                    color: '#69C5E9',
		                    borderWidth: 5,
		                    borderColor: "#69C5E9",
		                    label:{
		                    	show:true,
		                    	position:"bottom"
		                    }
		                }
		            },
		            smooth: true
		        },
		        {
		            name: '预计返岗人数',
		            type: 'line',
		            data: datay12,
		            color: "#F58080",
		            lineStyle: {
		                normal: {
		                    width: 3,
		                    color: {
		                        type: 'linear',

		                        colorStops: [{
		                            offset: 0,
		                            color: '#FFC9EB' // 0% 处的颜色
		                        },{
		                            offset: 1,
		                            color: '#F095CE' // 100% 处的颜色
		                        }],
		                        globalCoord: false // 缺省为 false
		                    },
		                }
		            },
		            itemStyle: {
		                normal: {
		                    color: '#F095CE',
		                    borderWidth: 5,
		                    borderColor: "#F095CE",
		                    label:{
		                    	show:true,
		                    	position:"bottom"
		                    }
		                }
		            },
		            smooth: true
		        },
		    ]
		};
		myChart.setOption(option);
		}
	});
}

function fetchyqqs(){
	var datax = [];
	var datay1 = [];
	var datay2 = [];
	var datay3 = [];
	var datay4 = [];
	var data = {type:'1'};
	$.ajax({
		url : "./search/fetchYqqs",
		dataType : "json",
		data : data,
		async:false,
		success : function(data) {
			for(var i=0;i<data.length;i++){
				datax.push(data[i].statisticDate);
				datay1.push(data[i].totalAmountFOfever);
				datay2.push(data[i].totalAmountOfSeemingly);
				datay3.push(data[i].totalAmountOfConfirmed);
				datay4.push(data[i].totalAmountOfCured);
			}
			var myChart = echarts.init(document.getElementById('main_six'));
			var option = {
		    tooltip: {
		        trigger: 'axis'
		    },
		    legend: {
		        color: ["#F58080", "#47D8BE", "#F9A589"],
		        data: ['累计发热人数','累计疑似病例人数','累计确诊人数','累计治愈人数'],
		        top: '1',
				orient: 'horizontal',
				x: 'center',
				y: 'top',
				textStyle: {
		            fontSize:20,
		        },
		    },
		    grid: {
		    	top: '15%',
		        left: '12%',
		        right: '5%',
		    },
		    xAxis: {
		        type: 'category',
		        data: datax,
		        axisLabel:{
		        	rotate : 45
		        },
		    },
		    yAxis: {
		        type: 'value',

		        splitLine: {
		            lineStyle: {
		                type: 'dashed',
		                color: '#DDD'
		            }
		        },
		        axisLine: {
		            show: false,
		            lineStyle: {
		                color: "#333"
		            },
		        },
		        nameTextStyle: {
		            color: "#999"
		        },
		        splitArea: {
		            show: false
		        }
		    },
		    dataZoom: [{
				show: true,
				height: 20,
				startValue: datax.length-10,
				handleStyle:{
					color:"#d3dee5",

				},
				textStyle:{
					color:"#fff"
				},
				borderColor:"#90979c"

			}, {
				type: "inside",
				show: true,
				height: 15,
				start: 1,
				end: 35
			}],
		    series: [{
		            name: '累计发热人数',
		            type: 'line',
		             smooth: true,
		            data: datay1,
		            color: "#F58080",
		            lineStyle: {
		                normal: {
		                    width: 3,
		                    color: {
		                        type: 'linear',

		                        colorStops: [{
		                            offset: 0,
		                            color: '#DDA0DD' // 0% 处的颜色
		                        }, {
		                            offset: 0.54,
		                            color: '#DA70D6' // 100% 处的颜色
		                        }, {
		                            offset: 1,
		                            color: '#BA55D3' // 100% 处的颜色
		                        }],
		                        globalCoord: false // 缺省为 false
		                    },
		                }
		            },
		            itemStyle: {
		                normal: {
		                    color: '#BA55D3',
		                    borderWidth: 5,
		                    borderColor: "#BA55D3"
		                }
		            },
		            smooth: true
		        },
		        {
		            name: '累计疑似病例人数',
		            type: 'line',
		             smooth: true,
		            data: datay2,
		            lineStyle: {
		                normal: {
		                    width: 3,
		                    color: {
		                        type: 'linear',

		                        colorStops: [{
		                                offset: 0,
		                                color: '#FFD39B' // 0% 处的颜色
		                            },
		                            {
		                                offset: 0.4,
		                                color: '#EEC591' // 100% 处的颜色
		                            }, {
		                                offset: 1,
		                                color: '#CDAA7D' // 100% 处的颜色
		                            }
		                        ],
		                        globalCoord: false // 缺省为 false
		                    },
		                }
		            },
		            itemStyle: {
		                normal: {
		                    color: '#CDAA7D',
		                    borderWidth: 5,
		                    borderColor: "#CDAA7D"
		                }
		            },
		            smooth: true
		        },
		        {
		            name: '累计确诊人数',
		            type: 'line',
		             smooth: true,
		            data: datay3,
		            color: "#F58080",
		            lineStyle: {
		                normal: {
		                    width: 3,
		                    color: {
		                        type: 'linear',

		                        colorStops: [{
		                            offset: 0,
		                            color: '#FF8247' // 0% 处的颜色
		                        }, {
		                            offset: 0.54,
		                            color: '#EE7942' // 100% 处的颜色
		                        }, {
		                            offset: 1,
		                            color: '#CD6839' // 100% 处的颜色
		                        }],
		                        globalCoord: false // 缺省为 false
		                    },
		                }
		            },
		            itemStyle: {
		                normal: {
		                    color: '#CD6839',
		                    borderWidth: 5,
		                    borderColor: "#CD6839"
		                }
		            },
		            smooth: true
		        },
		        {
		            name: '累计治愈人数',
		             smooth: true,
		            type: 'line',
		            data: datay4,
		            color: "#F58080",
		            lineStyle: {
		                normal: {
		                    width: 3,
		                    color: {
		                        type: 'linear',

		                        colorStops: [{
		                            offset: 0,
		                            color: '#C1FFC1' // 0% 处的颜色
		                        }, {
		                            offset: 0.54,
		                            color: '#B4EEB4' // 100% 处的颜色
		                        }, {
		                            offset: 1,
		                            color: '#9BCD9B' // 100% 处的颜色
		                        }],
		                        globalCoord: false // 缺省为 false
		                    },
		                }
		            },
		            itemStyle: {
		                normal: {
		                    color: '#9BCD9B',
		                    borderWidth: 5,
		                    borderColor: "#9BCD9B"
		                }
		            },
		            smooth: true
		        }
		    ]
		};
		myChart.setOption(option);
		}
	});
	
}

function getPxInfo(){
	
	var data = {conditionDate : new Date().format("yyyy-MM-dd")};
	var pxgsbgStr="";
	
	$.ajax({
		url : "search/getPxInfo",
		dataType : "json",
		data :data,
		success : function(data) {
			for(var i in data){
				pxgsbgStr+="<tr><td>"+data[i].client+"</td>";
				pxgsbgStr+="<td>"+data[i].trainPro+"</td>";
				pxgsbgStr+="<td>"+data[i].startDate+"</td>";
				pxgsbgStr+="<td>"+data[i].endDate+"</td>";
				pxgsbgStr+="<td>"+data[i].todayNum+"</td>";
				pxgsbgStr+="<td>"+data[i].incNum+"</td>";
				pxgsbgStr+="<td>"+data[i].decNum+"</td></tr>";
			}
			$("#pxbgbody").html(pxgsbgStr);
		}
	});
}
